#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>

int main(int argc,char *argv[])
{
 struct stat st;
 struct timespec ti1,ti2,ti3;
 stat(".",&st);
 printf("NO:%d\n",st.st_dev);
 printf("Inode:%d\n",st.st_ino);
 printf("protection:%d\n",st.st_mode);
 printf("number of hard links:%d\n",st.st_nlink);
 printf("Uid:%d\n",st.st_uid);
 printf("Gid:%d\n",st.st_gid);
 printf("total size,in bytes:%d\n",st.st_size);
 printf("blocksize for filesystem I/O:%d\n",st.st_blksize);
 printf("number of 512B blocks allocated:%d\n",st.st_blocks);
 ti1 = st.st_atim;
 ti2 = st.st_mtim;
 ti3 = st.st_ctim;
 printf("time of last access:%s and %ld\n",ti1.tv_sec,ti1.tv_nsec);
 return 0;
}
